@use '../core' as *;

.customMenu {
    display: none;
    padding-right: $spacing-size-2;
    user-select: none;

    @media screen and (min-width: 440px) {
        display: block;
    }

    @media screen and (min-width: $breakpoint-hero-small) {
        position: relative;
    }
}

.customTrigger {
    padding: 12px;
    padding-top: $spacing-size-1;
    padding-bottom: $spacing-size-1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition:
        background-color 0.3s,
        color 0.3s;
    font-weight: var(--text-semibold);
    font-size: 17px;
    border: none;
    border-radius: var(--radius-3xl);

    #{$selector-darkmode} & {
        background-color: var(--color-bg-primary);
        border-radius: var(--radius-3xl);
        border: none;
    }
}

.customTrigger:hover {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: var(--radius-3xl);
}

.customTrigger.open .arrow {
    margin-top: 4px;
    transform: rotate(225deg);
}

.customTrigger.open {
    background: rgba(255, 255, 255, 0.1);
    border: none;
}

.arrow {
    display: inline-block;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    padding: 3px;
    transform: rotate(45deg);
    transition: transform 0.3s;
    margin-left: 12px;
    margin-bottom: 2px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(-0.5rem) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.customContent {
    position: absolute;
    top: 52px;
    width: calc(100% - #{$spacing-size-3 * 2});
    left: $spacing-size-3;
    padding: $spacing-size-2;
    border-radius: var(--radius-md);
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border-primary);
    box-shadow: var(--shadow-sm);
    opacity: 0;
    z-index: 1;
    transform: translateY(10px) scale(0.95);
    transition:
        opacity 0.15s ease,
        transform 0.15s ease;

    @media screen and (min-width: $breakpoint-hero-small) {
        top: 100%;
        left: 0;
        width: 380px;
    }
}

.customMenu.open .customContent {
    animation: fadeInUp 0.15s ease-in-out;
    opacity: 1;
    transform: translateY(0) scale(1);
}

.productTitle {
    font-weight: var(--text-semibold);

    #{$selector-darkmode} & {
        color: var(--color-fg-primary);
    }
}

.productDescription {
    color: var(--color-text-secondary);
    opacity: 1;
    font-size: var(--text-fs-sm);
    font-weight: var(--text-regular);
}

.itemsWrapper {
    display: flex;
    padding: 8px;
    border-radius: var(--radius-md);
    transition: 0.5s all;
}

.itemsWrapper:first-child {
    display: flex;
    margin-bottom: $spacing-size-3;
}

.productsWrapper {
    display: flex;
    flex-direction: column;
    padding-left: $spacing-size-3;
}

.placeholderIcon {
    background: var(--color-util-brand-100);
    padding: 12px;
    border-radius: var(--radius-md);

    #{$selector-darkmode} & {
        background: color-mix(in srgb, var(--color-brand-300), var(--color-bg-primary) 90%);
    }
}

.itemsWrapper:hover {
    background: var(--color-util-brand-50);
    cursor: pointer;
    transition: 0.3s all ease-in-out;

    #{$selector-darkmode} & {
        background: color-mix(in srgb, var(--color-brand-300), var(--color-bg-primary) 96%);
    }
}

.iconLight {
    #{$selector-darkmode} & {
        display: none;
    }
}

.iconDark {
    display: none;

    #{$selector-darkmode} & {
        display: block;
    }
}
